## Adjust the paths to Boehm GC headers and libraries
## to fit your system (the $INC and $LIB variables)

CC=gcc
CFLAGS=-ansi -pedantic -Wall -DDEBUG -g
LDFLAGS=-lgc
RM=rm
LD=ld
INC=-I/sw/include
LIB=-L/sw/lib
OBJ=init.o object.o number.o string.o symbol.o \
    pair.o function.o env.o #interp.o

all: $(OBJ) main

## Just make sure they compile & then clear
test: all clean

main: main.c blisp.h
	$(CC) $(CFLAGS) $(INC) $(LIB) $(LDFLAGS) main.c $(OBJ) -o $@

init.o: init.c blisp.h
	$(CC) $(CFLAGS) $(INC) -c init.c

object.o: object.c blisp.h
	$(CC) $(CFLAGS) $(INC) -c object.c

number.o: number.c blisp.h
	$(CC) $(CFLAGS) $(INC) -c number.c

string.o: string.c blisp.h
	$(CC) $(CFLAGS) $(INC) -c string.c

symbol.o: symbol.c blisp.h
	$(CC) $(CFLAGS) $(INC) -c symbol.c

pair.o: pair.c blisp.h
	$(CC) $(CFLAGS) $(INC) -c pair.c

function.o: function.c blisp.h
	$(CC) $(CFLAGS) $(INC) -c function.c

env.o: env.c blisp.h
	$(CC) $(CFLAGS) $(INC) -c env.c

#interp.o: interp.c blisp.h interp_priv.h
#	$(CC) $(CFLAGS) $(INC) -c interp.c

clean:
	$(RM) *.o main
